<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Compra y Venta</title>
    </h:head>
    <h:body>
        <h:form>
            <p:growl id="growl"/>
           
            <h:panelGrid columns="3" id="grid">
                <h:outputText value="nombre"/>
                <h:inputText value="#{clienteBean.cliente.nombre}" required="true" requiredMessage="Cliente Requerido" id="id_in"/>
            </h:panelGrid>
            
            <p:commandButton value="Guardar" action="#{clienteBean.crearCliente}" update="table growl grid" process="@this id_in"/>
            
            <p:dataTable value="#{clienteBean.clientes}" var="cliente" id="table">
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="nombre"/>
                    </f:facet>
            
                    <h:outputText value="#{cliente.nombre}"/>
                </p:column>
            </p:dataTable>
        </h:form>
    </h:body>
</html>

